<?php
class DataOutputContext {
	protected $doObj;
	
	public function __construct($type) {
		$clz = ucfirst($type) . 'DataOutput';
		if(!class_exists($clz))  DataException::throwEx("DataOutput: {$type} not found!");
		$this->doObj = new $clz();
	}
	
	public function getDataOutput() {
		return $this->doObj;
	}
	
	public function handle($data) {
		return $this->doObj->handle($data);
	}
}

final class DOC extends DataOutputContext {}
?>